<template>
  <div>
    <el-dialog title="病历" :visible.sync="dialogShow" width="720px" @close="cancelInfo">
      <div class="modelInfo">
        <vue-scroll ref="vs" :ops="$store.state.ops">
          <div class="modelInfo_box">
            <span class="infoTitle">就诊概况</span>
            <span class="infoDetail">
              <span class="patientInfo">
                <span class="fontColor">就诊人：</span>
                <span class="margin8">{{info.patientName | patientName}}</span>
                <span class="margin8">{{info.patientSex | patientSex}}</span>
                <span class="margin8">{{info.patientAge | patientAge}}</span>
              </span>
              <span class="patientInfo">
                <span class="fontColor">就诊时间：</span>
                <span class="margin8">{{info.orderTime || info.createDate | baseTimeFun}}</span>
              </span>
              <span class="patientInfo">
                <span class="fontColor">就诊医生：</span>
                <span class="margin8">{{info.doctorName}}</span>
                <span class="margin8">{{info.department}}</span>
                <span class="margin8">{{info.doctorTitle}}</span>
              </span>
            </span>
            <span class="infoTitle">患者主诉：</span>
            <span class="infoDetail">{{info.illnessDesc}}</span>
            <span class="infoTitle">初步诊断</span>
            <span class="infoDetail">{{info.firstDiagnose}}</span>
            <span class="infoTitle">处理意见</span>
            <span class="infoDetail">{{info.treatmentSuggestion}}</span>
          </div>
        </vue-scroll>
      </div>
      <div class="modelbottom">
        <div class="modelBtn cursor" @click="cancelInfo">关闭</div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: ["showTrue", "patientData"],
  data() {
    return {
      dialogShow: false,
      info: {}
    };
  },
  filters: {
    patientName: function(val) {
      return val ? val : "未知";
    },
    patientSex: function(val) {
      var data = "";
      if (val == 0) {
        data = "女";
      } else if (val == 1) {
        data = "男";
      } else {
        data = "未知";
      }
      return data;
    },
    patientAge: function(val) {
      return val ? val + "岁" : "未知";
    }
  },
  watch: {
    showTrue(val) {
      this.dialogShow = val;
    },
    patientData(val) {
      this.info = { ...val };
    }
  },
  created() {
    this.info = { ...this.patientData };
  },
  methods: {
    cancelInfo() {
      this.$emit("close");
    }
  }
};
</script>

<style scoped rel="stylesheet">
.modalwrap {
  z-index: 2012;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  width: 720px;
  height: 705px;
  font-size: 14px;
  font-family: MicrosoftYaHei;
  user-select: none;
  background-color: #fff;
  box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.modelTitle {
  padding: 16px 24px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  font-weight: bold;
  color: rgba(42, 41, 40, 1);
}

.modelInfo {
  height: 545px;
  overflow: hidden;
}
.modelInfo_box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 40px;
  padding-bottom: 10px;
}
.infoTitle {
  font-size: 16px;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: bold;
  color: rgba(42, 41, 40, 1);
  line-height: 60px;
}
.infoDetail {
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: rgba(55, 55, 55, 1);
  line-height: 20px;
}
.margin8 {
  margin: 0 8px;
}
.patientInfo {
  display: inline-block;
  width: 48%;
  line-height: 32px;
}
.fontColor {
  font-weight: 400;
  color: rgba(122, 118, 118, 1);
}
.modelbottom {
  width: 100%;
  height: 100px;
  background: #F1F1F1;
  box-shadow: 0px 0px 0px 0px rgba(228, 228, 228, 1);
  border-radius: 0px 0px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modelBtn {
  width: 160px;
  height: 40px;
  text-align: center;
  background: rgba(255, 101, 50, 1);
  border-radius: 20px;
  color: rgba(255, 255, 255, 1);
  line-height: 40px;
}

@keyframes bounce-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
</style>
